//
//  EduExperienceTCell.m
//  jzyParents
//
//  Created by 任辰东 on 2025/2/17.
//

#import "EduExperienceTCell.h"

@interface EduExperienceTCell ()

@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) UILabel *timeLabel;
@property (nonatomic, strong) UILabel *organLabel;

@end

@implementation EduExperienceTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)configCellWithModel:(EduExperienceModel *)model
{
    [self.timeLabel setText:model.shijian lineSpacing:5];
    [self.organLabel setText:model.organ_name lineSpacing:5];
}

-(void)setupViews
{
    self.contentView.backgroundColor = UIColorFromHex(kColorBG);
    [self.contentView addSubview:self.containerView];
    [self.containerView addSubview:self.timeLabel];
    [self.containerView addSubview:self.organLabel];
    
}

-(void)setupLayout
{
    [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.left.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView).offset(-10);
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.containerView).offset(15);
        make.left.equalTo(self.containerView).offset(15);
        make.right.equalTo(self.containerView).offset(-15);
        
    }];
    
    [self.organLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.timeLabel.mas_bottom).offset(8);
        make.left.equalTo(self.containerView).offset(15);
        make.right.equalTo(self.containerView).offset(-15);
        make.bottom.equalTo(self.containerView).offset(-15);
        
    }];
}

-(UIView *)containerView
{
    if (!_containerView) {
        _containerView = [UIView new];
        _containerView.backgroundColor = UIColorFromHex(kColorWhite);
        [_containerView addBottomLine];
        [_containerView addTopLine];
    }
    return _containerView;
}

-(UILabel *)timeLabel
{
    if (!_timeLabel) {
        _timeLabel = [UILabel new];
        _timeLabel.text = @"  ";
        _timeLabel.font = UIFontSize(18);
        _timeLabel.numberOfLines = 0;
        _timeLabel.textColor = UIColorFromHex(kColorTitle);
    }
    return _timeLabel;
}

-(UILabel *)organLabel
{
    if (!_organLabel) {
        _organLabel = [UILabel new];
        _organLabel.text = @"  ";
        _organLabel.font = UIFontSize(18);
        _organLabel.numberOfLines = 0;
        _organLabel.textColor = UIColorFromHex(kColorTitle);
    }
    return _organLabel;
}

@end
